<include file="/public/header" />
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="ouser_id">
                                <option value="">{:__('司机')}</option>
                                <foreach $user1 as $v>
                                    <option value="{$v.id}">{$v.name}</option>
                                </foreach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="user_id">
                                <option value="">{:__('下单员')}</option>
                                <foreach $user2 as $v>
                                    <option value="{$v.id}">{$v.name}</option>
                                </foreach>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <input name="nickname" class="layui-input" type="text" placeholder="{:__('姓名、电话、非司机配送人员电话')}" />
                        </div>
                    </div>
                    <div class="layui-inline">
                        <!-- // 默认搜索 -->
                        <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit><i
                                class="layui-icon layui-icon-search"></i>{:__('搜索')}</button>
                    </div>
                </div>
            </div>
        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>

<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a class="layui-table-text" data-title="{:__('查看')}" data-area="862px,95%"  data-url="{:url('/system/putorder/look')}?id={{d.id}}" lay-event="edit">{:__('查看')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    {{#  if(d.status < 6){ }}
    <a class="layui-table-text" data-title="{:__('商品')}" data-area="80%,95%"  data-url="{:url('/system/putorder/goods')}?id={{d.id}}" lay-event="edit">{:__('商品')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a class="layui-table-text" data-title="{:__('编辑')}" data-area="862px,95%"  data-url="{:url('/system/putorder/edit')}?id={{d.id}}" lay-event="edit">{:__('编辑')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    {{#  } }}
    <a class="layui-table-text" data-url="{:url('/system/putorder/del')}?id={{d.id}}" lay-event="del">{:__('删除')}</a>
</script>

<include file="/public/footer" />
<script>
    layui.use(['admin', 'table', 'form'], function () {
        var admin = layui.admin;
        var table = layui.table;
        var form = layui.form;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url('/system/putorder/index')}"
            , page: true
            , limit: 18
            , toolbar: 'true'
            , cols: [[
                { type: 'checkbox', width: 50 },
                { field: 'id', align: 'center', sort: true, width: 80, title: 'ID' },
                { field: 'name',width: 130, align: 'center', title: '{:__("客户")}' },
                { field: 'mobile',width: 130, align: 'center', title: '{:__("客户电话")}' },
                { field: 'create_time',width: 200, align: 'center', title: '{:__("下单时间")}' },
                { field: 'yjsd',width: 160, align: 'center', title: '{:__("需送达时间")}' },
                { field: 'readdress',width: 200, align: 'center', title: '{:__("定位地址")}' },
                { field: 'address',width: 130, align: 'center', title: '{:__("详细地址")}' },
                {
                    field: 'address',width: 120, align: 'center', title: '{:__("是否拆分")}', templet: function (d) {
                        return d.topid > 0 ? '是' : '';
                    },
                },
                {
                    field: 'address',width: 120, align: 'center', title: '{:__("是否多地址")}', templet: function (d) {
                        return d.addcount > 0 ? '是' : '';
                    },
                },
                {
                    field: 'address',width: 130, align: 'center', title: '{:__("下单员")}', templet: function (d) {
                        return d.put_name + '<br/>' + d.put_mobile;
                    },
                },
                {
                    field: 'address',width: 130, align: 'center', title: '{:__("配送司机")}', templet: function (d) {
                        return d.send_name + '<br/>' + d.send_mobile;
                    },
                },
                { field: 'send_text',width: 130, align: 'center', title: '{:__("配送类型")}' },
                { field: 'status_text',width: 150, align: 'center', title: '{:__("状态")}' },
                { field: 'remark', align: 'center', title: '{:__("备注")}' },
                { field: 'total', align: 'center', width: 180, title: '{:__("金额")}' },
                { align: 'center', toolbar: '#tableBar', width: 300, title: '{:__("操作")}' },
            ]]
        })
    })
</script>